package main
import (
	"context"
	"fmt"
	"github.com/micro/go-micro/v2"
	"my_micro/userserver/db"

)

type UserService struct{}

func (s *UserService) GetUser(ctx context.Context, req *user.GetUserReq, rsp *user.GetUserRep) error {
	return nil
}

func (s *UserService) DeleteUser(ctx context.Context, req *user.DeleteUserReq, rsp *user.DeleteUserRep) error {
	return nil
}

func (s *UserService) InsertUser(ctx context.Context, req *user.InsertUserReq, rsp *user.InsertUserRep) error {
	return nil
}
func (s *UserService) ModifyUser(ctx context.Context, req *user.ModifyUserReq, rsp *user.ModifyUserRep) error {
	return nil
}

func (s *UserService) Test(ctx context.Context, req *user.GetUserReq, rsp *user.GetUserRep) error{
	req.Id = 3
	rsp.Phone = "dddddd"
	return nil
}

func main() {
	ser := micro.NewService(
		micro.Name("go.micro.api.userserver"),
		micro.Version("latest"),
	) 

	ser.Init()

	_ = user.RegisterUserServiceHandler(ser.Server(), new(UserService))
	if err := ser.Run(); err != nil {
		fmt.Println("micro stop")
	}
}